package com.itheima.innerClass.test2;

public class TestInner {
    public static void main(String[] args) {
        //应用场景
            //在方法的形参是接口的话,就可以使用匿名内部类当参数传递给这个方法!
        goSwimming(new Swimming() {
            @Override
            public void swimming() {
                System.out.println("铁汁,我们去游泳吧");
            }
        });

    }

    public static void goSwimming(Swimming swimming) {
        swimming.swimming();
    }
}

interface Swimming {
    void swimming();
}
